package middlewares

const (
	SIGN_BLOCK      = "SIGN:BLOCK{Sign}" //黑名单
	SIGN_WHITE      = "SIGN:WHITE{Sign}" //白名单
	SIGN_LIMIT      = "SIGN:LIMIT{Sign}" //限流
	LIMIT_FREQUENCY = 100                // 单位时间次数
	LIMIT_UNIT      = 5                  //秒
	BLOCK_TIME_UNIT = 180                //秒
	SIGN_ERROR_CODE = 507                //错误码
	PARAMS_SPLIT    = "|"                //参数之间的分隔符
	URL_PATH_SPLIT  = "/"                //URL的分隔符
)

var verifySign map[string]string
var specialMethod map[string]string
var versionMap map[string]string

/**
 * @Author willi
 * @Description //TODO
 * @Date 15:17 2022/9/21
 * @Param
 * @return
 **/
func initVerifySign() {
	verifySign = make(map[string]string)

	//verifySign["/api/match/getRecommendMatches4Crawler"] = "getRecommendMatches4Crawler" //pc首页赛事推荐
	//verifySign["/api/match/getCompMenuList"] = "getCompMenuList"                         //赛事菜单

	verifySign["/api/match/getMatchList"] = "sport_id" //赛事
	verifySign["/api/match/countUserFavorite"] = ""
	verifySign["/api/match/favoriteMatch"] = "match_id|operate|sport_id"
	verifySign["/api/match/getMatchScoreList"] = "sport_id"
	verifySign["/api/match/getCompMenuList"] = "sport_id"

	verifySign["/api/noble/chargeNoble"] = "anchor_id|id"
	verifySign["/api/noble/receiveNoble"] = ""

	verifySign["/api/odds/basketball_history"] = "company_id|ex_type|match_id"
	verifySign["/api/odds/basketball_initial"] = "ex_type|match_id"
	verifySign["/api/odds/football_history"] = "company_id|ex_type|match_id"
	verifySign["/api/odds/football_initial"] = "ex_type|match_id"

	verifySign["/api/order/send"] = "amount|currency|payment_account_id"
	verifySign["/api/payment/applyHsqPayment"] = "client_ip|pay_type|product_id"
	verifySign["/api/tencentIm/getUserSig"] = ""

	verifySign["/api/anchor/attentAnchor"] = ""
	verifySign["/api/anchor/attentAnchors"] = ""
	verifySign["/api/anchor/checkAnchorExist"] = ""
	verifySign["/api/anchor/checkAttent"] = ""

	verifySign["/api/user/login"] = "account|pwd"
	verifySign["/api/user/updateNickName"] = "nickname|sms_code"
	verifySign["/api/user/sendVerifyCode"] = "is_change_mobile|is_register|mobile"
	verifySign["/api/user/addBank"] = "bank|card|id_card|name"
	verifySign["/api/user/readyForTakeOff"] = "mobile|smscode"
	verifySign["/api/user/changeMobile"] = "new_mobile|new_smscode|ori_sms_code"
	verifySign["/api/user/changePayPwd"] = "pwd|smscode"
	verifySign["/api/user/changePwd"] = "pwd|smscode"
	verifySign["/api/user/deactive"] = "recall"
	verifySign["/api/user/editUserInfo"] = "age|avatarId|career|city|code|height|nick_name"
	verifySign["/api/user/fastLogin"] = "ip|key|mobile|platform|source_key"
	verifySign["/api/user/forgetPwd"] = "mobile|pwd|smscode"
	verifySign["/api/user/forgetPwdHash"] = "mobile|mobile_hash|pwd"
	verifySign["/api/user/login"] = "account|pwd"
	verifySign["/api/user/readyForTakeOff"] = "mobile|smscode"
	verifySign["/api/user/sendCode"] = "is_change_mobile|is_register|mobile|nation_code"
	verifySign["/api/user/userBackpack"] = ""

	verifySign["/api/auth/sendBindCode"] = "mobile"

	verifySign["/api/expert/attentionExpert"] = "attention|expert_id"
	verifySign["/api/expert/payExpertPlanFee"] = "expert_plan_id|fee_type"

	verifySign["/api/models_guess/cancelGuess"] = "anchor_id|g_id"
	verifySign["/api/models_guess/closeGuess"] = "anchor_id|g_id"
	verifySign["/api/models_guess/createGuess"] = "anchor_id|category_id|duration|live_id|q_id"
	verifySign["/api/models_guess/createGuessOrder"] = "amount|g_id|guess_item|live_id"
	verifySign["/api/models_guess/createQuestion"] = "comp|content|item_num|match_id|min_bet|title"
	verifySign["/api/models_guess/delQuestion"] = "q_id"
	verifySign["/api/models_guess/settleGuess"] = "anchor_id|g_id|result"

	verifySign["/api/moment/SendFeedback"] = "content|title"
	verifySign["/api/hongBao/provideHongBao"] = "attention|delay_time|live_id|total_diamond|total_quantity"

	verifySign["/api/models_live/checkIsMgr"] = "anchorid|target_user_id"
	verifySign["/api/models_live/editLive"] = "cateid|liveid|match_id|sport_type|title"
	verifySign["/api/models_live/getStreamInfo"] = ""
	verifySign["/api/models_live/hotLive"] = "client_ip"
	verifySign["/api/models_live/live_history"] = "end_date|id|start_date"
	verifySign["/api/models_live/startLive"] = "anchor_secret|category|cateid|match_id|price|room_type"
	verifySign["/api/models_live/visit_clean"] = ""
	verifySign["/api/models_live/visit_record"] = "live_id|platform"

	verifySign["/api/order/send"] = "amount|currency|payment_account_id"

	verifySign["/api/payment/applyHsqPayment"] = "client_ip|pay_type|product_id"

	verifySign["/api/withdraw/add"] = "apply_amount|bank_id|smscode"
	verifySign["/api/withdraw/banks"] = "id|name|status"
	verifySign["/api/withdraw/verifyWithdrawPass"] = "pay_password"
	verifySign["/api/withdraw/withdraws"] = "end_time|start_time|status"
	verifySign["/api/config/getCommonConfig"] = ""

	/*                                      //统计收藏数量













	verifySign["/api/withdraw/add"] = "add"
	verifySign["/api/withdraw/banks"] = "banks"
	verifySign["/api/withdraw/verifyWithdrawPass"] = "verifyWithdrawPass"
	verifySign["/api/withdraw/withdraws"] = "withdraws"
	verifySign["/api/config/getCommonConfig"] = "getCommonConfig"*/

	/*verifySign["/webapi/match/getMatchList"] = "getMatchList"                               //赛事
	verifySign["/webapi/match/getCompMenuList"] = "getCompMenuList"                         //赛事菜单
	verifySign["/webapi/match/getRecommendMatches4Crawler"] = "getRecommendMatches4Crawler" //pc首页赛事推荐
	verifySign["/webapi/match/countUserFavorite"] = "countUserFavorite"                     //统计收藏数量
	verifySign["/webapi/anchor/attentAnchor"] = "attentAnchor"
	verifySign["/webapi/anchor/attentAnchors"] = "attentAnchors"
	verifySign["/webapi/anchor/checkAnchorExist"] = "checkAnchorExist"
	verifySign["/webapi/anchor/checkAttent"] = "checkAttent"
	verifySign["/webapi/auth/sendBindCode"] = "sendBindCode"
	verifySign["/webapi/expert/attentionExpert"] = "attentionExpert"
	verifySign["/webapi/expert/payExpertPlanFee"] = "payExpertPlanFee"
	verifySign["/webapi/models_guess/cancelGuess"] = "cancelGuess"
	verifySign["/webapi/models_guess/closeGuess"] = "closeGuess"
	verifySign["/webapi/models_guess/createGuess"] = "createGuess"
	verifySign["/webapi/models_guess/createGuessOrder"] = "createGuessOrder"
	verifySign["/webapi/models_guess/createQuestion"] = "createQuestion"
	verifySign["/webapi/models_guess/delQuestion"] = "delQuestion"
	verifySign["/webapi/models_guess/settleGuess"] = "settleGuess"
	verifySign["/webapi/moment/SendFeedback"] = "SendFeedback"
	verifySign["/webapi/hongBao/provideHongBao"] = "provideHongBao"
	verifySign["/webapi/ip/astrict_area"] = "astrict_area"
	verifySign["/webapi/ip/search"] = "search"
	verifySign["/webapi/models_live/checkIsMgr"] = "checkIsMgr"
	verifySign["/webapi/models_live/editLive"] = "editLive"
	verifySign["/webapi/models_live/endLive"] = "endLive"
	verifySign["/webapi/models_live/getStreamInfo"] = "getStreamInfo"
	verifySign["/webapi/models_live/hotLive"] = "hotLive"
	verifySign["/webapi/models_live/live_history"] = "live_history"
	verifySign["/webapi/models_live/startLive"] = "startLive"
	verifySign["/webapi/models_live/visit_clean"] = "visit_clean"
	verifySign["/webapi/models_live/visit_record"] = "visit_record"
	verifySign["/webapi/match/cancelReserveMatch4Crawler"] = "cancelReserveMatch4Crawler"
	verifySign["/webapi/match/favoriteMatch"] = "favoriteMatch"
	verifySign["/webapi/match/getMatchScoreList"] = "getMatchScoreList"
	verifySign["/webapi/match/reserveMatch4Crawler"] = "reserveMatch4Crawler"
	verifySign["/webapi/noble/chargeNoble"] = "chargeNoble"
	verifySign["/webapi/noble/receiveNoble"] = "receiveNoble"
	verifySign["/webapi/odds/basketball_history"] = "basketball_history"
	verifySign["/webapi/odds/basketball_initial"] = "basketball_initial"
	verifySign["/webapi/odds/football_history"] = "football_history"
	verifySign["/webapi/odds/football_initial"] = "football_initial"
	verifySign["/webapi/order/send"] = "send"
	verifySign["/webapi/payment/applyHsqPayment"] = "applyHsqPayment"
	verifySign["/webapi/tencentIm/getUserSig"] = "getUserSig"
	verifySign["/webapi/user/addBank"] = "addBank"
	verifySign["/webapi/user/readyForTakeOff"] = "readyForTakeOff"
	verifySign["/webapi/user/changeMobile"] = "changeMobile"
	verifySign["/webapi/user/changePayPwd"] = "changePayPwd"
	verifySign["/webapi/user/changePwd"] = "changePwd"
	verifySign["/webapi/user/deactive"] = "deactive"
	verifySign["/webapi/user/delBank"] = "delBank"
	verifySign["/webapi/user/editUserInfo"] = "editUserInfo"
	verifySign["/webapi/user/fastLogin"] = "fastLogin"
	verifySign["/webapi/user/forgetPwd"] = "forgetPwd"
	verifySign["/webapi/user/forgetPwdHash"] = "forgetPwdHash"
	verifySign["/webapi/user/getBanks"] = "getBanks"
	verifySign["/webapi/user/login"] = "login"
	verifySign["/webapi/user/logout"] = "logout"
	verifySign["/webapi/user/readyForTakeOff"] = "readyForTakeOff"
	verifySign["/webapi/user/receiveReward"] = "receiveReward"
	verifySign["/webapi/user/sendCode"] = "sendCode"
	verifySign["/webapi/user/sendVerifyCode"] = "sendVerifyCode"
	verifySign["/webapi/user/updateNickName"] = "updateNickName"
	verifySign["/webapi/user/userBackpack"] = "userBackpack"
	verifySign["/webapi/withdraw/add"] = "add"
	verifySign["/webapi/withdraw/banks"] = "banks"
	verifySign["/webapi/withdraw/verifyWithdrawPass"] = "verifyWithdrawPass"
	verifySign["/webapi/withdraw/withdraws"] = "withdraws"
	verifySign["/webapi/config/getCommonConfig"] = "getCommonConfig"*/

}

func init() {
	initVerifySign()
	//特殊情况下可以新增一个参数合到Method
	specialMethod = make(map[string]string)
	specialMethod["getCompMenuList"] = "MatchStatus"
	specialMethod["getMatchList"] = "MatchStatus"

	versionMap = make(map[string]string)
	//再增加一个接口rsa非对加密，加密干扰码，下发到客户端
	versionMap["V1"] = "qwertyuiaadfaopasdfghj111klzxcvbnmQWERTYUIOPASDFGHJKLZX12311CVBNM123456dadfasddsadad7890"
	versionMap["V2"] = "qwertyuiopaaaaaas1231dfghjklzxcvbn121mQWERTYUIOPA1231SDFGHJKLZXCaddddVBNM12dadd34567addadf"
	versionMap["V3"] = "qwertyuiopaadfaadaddsd121fghjklzxcvbnmQWERTYUIOadfadweradfPASDFGHJKaadLZXCVBN112M1dadf2345addadd0"
}
